<?php
/**
 * PreModerationResponse
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Sponsored Brands campaign management
 *
 * Create and manage Sponsored Brands campaigns.   To learn more about Sponsored Brands campaigns, see:   - [Sponsored Brands overview](guides/sponsored-brands/overview)  - [Sponsored Brands campaign structure](guides/sponsored-brands/campaigns/structure)  - [Get started with Sponsored Brands campaigns](guides/sponsored-brands/campaigns/get-started-with-campaigns)
 *
 * OpenAPI spec version: 4.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * PreModerationResponse Class Doc Comment
 *
 * @category Class
 * @description Information regarding the policy violations if present for the components, sent for pre moderation.
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class PreModerationResponse implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'PreModerationResponse';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'record_id' => 'string',
        'asin_components' => '\AmazonAdvertisingApi\Model\AsinComponentResponse[]',
        'pre_moderation_id' => 'string',
        'ad_program' => 'string',
        'locale' => 'string',
        'image_components' => '\AmazonAdvertisingApi\Model\ImageComponentResponse[]',
        'date_components' => '\AmazonAdvertisingApi\Model\DateComponentResponse[]',
        'text_components' => '\AmazonAdvertisingApi\Model\TextComponentResponse[]',
        'video_components' => '\AmazonAdvertisingApi\Model\VideoComponentResponse[]'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'record_id' => null,
        'asin_components' => null,
        'pre_moderation_id' => null,
        'ad_program' => null,
        'locale' => null,
        'image_components' => null,
        'date_components' => null,
        'text_components' => null,
        'video_components' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'record_id' => 'recordId',
        'asin_components' => 'asinComponents',
        'pre_moderation_id' => 'preModerationId',
        'ad_program' => 'adProgram',
        'locale' => 'locale',
        'image_components' => 'imageComponents',
        'date_components' => 'dateComponents',
        'text_components' => 'textComponents',
        'video_components' => 'videoComponents'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'record_id' => 'setRecordId',
        'asin_components' => 'setAsinComponents',
        'pre_moderation_id' => 'setPreModerationId',
        'ad_program' => 'setAdProgram',
        'locale' => 'setLocale',
        'image_components' => 'setImageComponents',
        'date_components' => 'setDateComponents',
        'text_components' => 'setTextComponents',
        'video_components' => 'setVideoComponents'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'record_id' => 'getRecordId',
        'asin_components' => 'getAsinComponents',
        'pre_moderation_id' => 'getPreModerationId',
        'ad_program' => 'getAdProgram',
        'locale' => 'getLocale',
        'image_components' => 'getImageComponents',
        'date_components' => 'getDateComponents',
        'text_components' => 'getTextComponents',
        'video_components' => 'getVideoComponents'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }

    const AD_PROGRAM_SPONSORED_BRANDS = 'SPONSORED_BRANDS';
    const AD_PROGRAM_SPONSORED_BRANDS_SPOTLIGHT = 'SPONSORED_BRANDS_SPOTLIGHT';
    const AD_PROGRAM_SPONSORED_BRANDS_VIDEO = 'SPONSORED_BRANDS_VIDEO';
    const AD_PROGRAM_STORES = 'STORES';
    const AD_PROGRAM_SPONSORED_DISPLAY = 'SPONSORED_DISPLAY';
    const AD_PROGRAM_DSP = 'DSP';
    const AD_PROGRAM_DSP_REC = 'DSP_REC';
    const AD_PROGRAM_DSP_IMAGE = 'DSP_IMAGE';
    const AD_PROGRAM_DSP_THIRD_PARTY = 'DSP_THIRD_PARTY';
    const LOCALE_AR_AE = 'ar-AE';
    const LOCALE_ZH_CN = 'zh-CN';
    const LOCALE_NL_NL = 'nl-NL';
    const LOCALE_EN_AU = 'en-AU';
    const LOCALE_EN_CA = 'en-CA';
    const LOCALE_EN_IN = 'en-IN';
    const LOCALE_EN_GB = 'en-GB';
    const LOCALE_EN_US = 'en-US';
    const LOCALE_FR_CA = 'fr-CA';
    const LOCALE_FR_FR = 'fr-FR';
    const LOCALE_DE_DE = 'de-DE';
    const LOCALE_IT_IT = 'it-IT';
    const LOCALE_JA_JP = 'ja-JP';
    const LOCALE_KO_KR = 'ko-KR';
    const LOCALE_PT_BR = 'pt-BR';
    const LOCALE_ES_ES = 'es-ES';
    const LOCALE_ES_US = 'es-US';
    const LOCALE_ES_MX = 'es-MX';
    const LOCALE_TR_TR = 'tr-TR';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getAdProgramAllowableValues()
    {
        return [
            self::AD_PROGRAM_SPONSORED_BRANDS,
            self::AD_PROGRAM_SPONSORED_BRANDS_SPOTLIGHT,
            self::AD_PROGRAM_SPONSORED_BRANDS_VIDEO,
            self::AD_PROGRAM_STORES,
            self::AD_PROGRAM_SPONSORED_DISPLAY,
            self::AD_PROGRAM_DSP,
            self::AD_PROGRAM_DSP_REC,
            self::AD_PROGRAM_DSP_IMAGE,
            self::AD_PROGRAM_DSP_THIRD_PARTY,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getLocaleAllowableValues()
    {
        return [
            self::LOCALE_AR_AE,
            self::LOCALE_ZH_CN,
            self::LOCALE_NL_NL,
            self::LOCALE_EN_AU,
            self::LOCALE_EN_CA,
            self::LOCALE_EN_IN,
            self::LOCALE_EN_GB,
            self::LOCALE_EN_US,
            self::LOCALE_FR_CA,
            self::LOCALE_FR_FR,
            self::LOCALE_DE_DE,
            self::LOCALE_IT_IT,
            self::LOCALE_JA_JP,
            self::LOCALE_KO_KR,
            self::LOCALE_PT_BR,
            self::LOCALE_ES_ES,
            self::LOCALE_ES_US,
            self::LOCALE_ES_MX,
            self::LOCALE_TR_TR,
        ];
    }

    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['record_id'] = isset($data['record_id']) ? $data['record_id'] : null;
        $this->container['asin_components'] = isset($data['asin_components']) ? $data['asin_components'] : null;
        $this->container['pre_moderation_id'] = isset($data['pre_moderation_id']) ? $data['pre_moderation_id'] : null;
        $this->container['ad_program'] = isset($data['ad_program']) ? $data['ad_program'] : null;
        $this->container['locale'] = isset($data['locale']) ? $data['locale'] : null;
        $this->container['image_components'] = isset($data['image_components']) ? $data['image_components'] : null;
        $this->container['date_components'] = isset($data['date_components']) ? $data['date_components'] : null;
        $this->container['text_components'] = isset($data['text_components']) ? $data['text_components'] : null;
        $this->container['video_components'] = isset($data['video_components']) ? $data['video_components'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        $allowedValues = $this->getAdProgramAllowableValues();
        if (!is_null($this->container['ad_program']) && !in_array($this->container['ad_program'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'ad_program', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        $allowedValues = $this->getLocaleAllowableValues();
        if (!is_null($this->container['locale']) && !in_array($this->container['locale'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'locale', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets record_id
     *
     * @return string
     */
    public function getRecordId()
    {
        return $this->container['record_id'];
    }

    /**
     * Sets record_id
     *
     * @param string $record_id Id of the brand/advertiser.
     *
     * @return $this
     */
    public function setRecordId($record_id)
    {
        $this->container['record_id'] = $record_id;

        return $this;
    }

    /**
     * Gets asin_components
     *
     * @return \AmazonAdvertisingApi\Model\AsinComponentResponse[]
     */
    public function getAsinComponents()
    {
        return $this->container['asin_components'];
    }

    /**
     * Sets asin_components
     *
     * @param \AmazonAdvertisingApi\Model\AsinComponentResponse[] $asin_components Pre moderation result of the asin components. It will have information regarding the policy violations present if any.
     *
     * @return $this
     */
    public function setAsinComponents($asin_components)
    {
        $this->container['asin_components'] = $asin_components;

        return $this;
    }

    /**
     * Gets pre_moderation_id
     *
     * @return string
     */
    public function getPreModerationId()
    {
        return $this->container['pre_moderation_id'];
    }

    /**
     * Sets pre_moderation_id
     *
     * @param string $pre_moderation_id Unique Id for the moderation Request.
     *
     * @return $this
     */
    public function setPreModerationId($pre_moderation_id)
    {
        $this->container['pre_moderation_id'] = $pre_moderation_id;

        return $this;
    }

    /**
     * Gets ad_program
     *
     * @return string
     */
    public function getAdProgram()
    {
        return $this->container['ad_program'];
    }

    /**
     * Sets ad_program
     *
     * @param string $ad_program Type of Ad program to which the pre moderation components belong to.
     *
     * @return $this
     */
    public function setAdProgram($ad_program)
    {
        $allowedValues = $this->getAdProgramAllowableValues();
        if (!is_null($ad_program) && !in_array($ad_program, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'ad_program', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['ad_program'] = $ad_program;

        return $this;
    }

    /**
     * Gets locale
     *
     * @return string
     */
    public function getLocale()
    {
        return $this->container['locale'];
    }

    /**
     * Sets locale
     *
     * @param string $locale Locale value that was passed in request.
     *
     * @return $this
     */
    public function setLocale($locale)
    {
        $allowedValues = $this->getLocaleAllowableValues();
        if (!is_null($locale) && !in_array($locale, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'locale', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['locale'] = $locale;

        return $this;
    }

    /**
     * Gets image_components
     *
     * @return \AmazonAdvertisingApi\Model\ImageComponentResponse[]
     */
    public function getImageComponents()
    {
        return $this->container['image_components'];
    }

    /**
     * Sets image_components
     *
     * @param \AmazonAdvertisingApi\Model\ImageComponentResponse[] $image_components Pre moderation result of the image components. It will have information regarding the policy violations present if any.
     *
     * @return $this
     */
    public function setImageComponents($image_components)
    {
        $this->container['image_components'] = $image_components;

        return $this;
    }

    /**
     * Gets date_components
     *
     * @return \AmazonAdvertisingApi\Model\DateComponentResponse[]
     */
    public function getDateComponents()
    {
        return $this->container['date_components'];
    }

    /**
     * Sets date_components
     *
     * @param \AmazonAdvertisingApi\Model\DateComponentResponse[] $date_components Pre moderation result of the date components. It will have information regarding the policy violations present if any.
     *
     * @return $this
     */
    public function setDateComponents($date_components)
    {
        $this->container['date_components'] = $date_components;

        return $this;
    }

    /**
     * Gets text_components
     *
     * @return \AmazonAdvertisingApi\Model\TextComponentResponse[]
     */
    public function getTextComponents()
    {
        return $this->container['text_components'];
    }

    /**
     * Sets text_components
     *
     * @param \AmazonAdvertisingApi\Model\TextComponentResponse[] $text_components Pre moderation result of the text components. It will have information regarding the policy violations present if any.
     *
     * @return $this
     */
    public function setTextComponents($text_components)
    {
        $this->container['text_components'] = $text_components;

        return $this;
    }

    /**
     * Gets video_components
     *
     * @return \AmazonAdvertisingApi\Model\VideoComponentResponse[]
     */
    public function getVideoComponents()
    {
        return $this->container['video_components'];
    }

    /**
     * Sets video_components
     *
     * @param \AmazonAdvertisingApi\Model\VideoComponentResponse[] $video_components Pre moderation result of the video components. It will have information regarding the policy violations present if any.
     *
     * @return $this
     */
    public function setVideoComponents($video_components)
    {
        $this->container['video_components'] = $video_components;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
